﻿using GalaSoft.MvvmLight;
using System;
using System.Drawing;

namespace TransControlSystem.Model
{
    public class TaskInfo : ObservableObject
    {
        /// <summary>
        /// 主键
        /// </summary>
        private int _Id;
        /// <summary>
        /// 主键
        /// </summary>
        public int Id
        {
            get { return _Id; }
            set
            {
                _Id = value;
                RaisePropertyChanged(() => Id);
            }
        }
        /// <summary>
        /// 任务描述
        /// </summary>
        private string _TaskDesc;
        /// <summary>
        /// 任务描述
        /// </summary>
        public string TaskDesc
        {
            get { return _TaskDesc; }
            set
            {
                _TaskDesc = value;
                RaisePropertyChanged(() => TaskDesc);
            }
        }
        /// <summary>
        /// 任务创建时间
        /// </summary>
        private DateTime _CreateTime;
        /// <summary>
        /// 任务创建时间
        /// </summary>
        public DateTime CreateTime
        {
            get { return _CreateTime; }
            set
            {
                _CreateTime = value;
                RaisePropertyChanged(() => CreateTime);
            }
        }
        /// <summary>
        /// 列表显示格式化之后的时间
        /// </summary>
        public string CreateTimeText
        {
            get
            {
                if (CreateTime != null && CreateTime.Ticks != 0)
                {
                    return CreateTime.Year + "年" + CreateTime.Month.ToString("00") + "月" + CreateTime.Day.ToString("00") + "日" + " " + CreateTime.Hour.ToString("00") + ":" + CreateTime.Minute.ToString("00") + ":" + CreateTime.Second.ToString("00");
                }
                return "";
            }
        }

        /// <summary>
        /// 任务开始时间
        /// </summary>
        private DateTime _StartTime;
        /// <summary>
        /// 任务开始时间
        /// </summary>
        public DateTime StartTime
        {
            get { return _StartTime; }
            set
            {
                _StartTime = value;
                RaisePropertyChanged(() => StartTime);
            }
        }
        /// <summary>
        /// 列表显示格式化之后的时间
        /// </summary>
        public string StartTimeText
        {
            get
            {
                if (StartTime != null && StartTime.Ticks != 0)
                {
                    return StartTime.Year + "年" + StartTime.Month.ToString("00") + "月" + StartTime.Day.ToString("00") + "日" + " " + StartTime.Hour.ToString("00") + ":" + StartTime.Minute.ToString("00") + ":" + StartTime.Second.ToString("00");
                }
                return "";
            }
        }
        /// <summary>
        /// 任务结束时间
        /// </summary>
        private DateTime _EndTime;
        /// <summary>
        /// 任务结束时间 
        /// </summary>
        public DateTime EndTime
        {
            get { return _EndTime; }
            set
            {
                _EndTime = value;
                RaisePropertyChanged(() => EndTime);
            }
        }
        /// <summary>
        /// 列表显示格式化之后的时间
        /// </summary>
        public string EndTimeText
        {
            get
            {
                if (EndTime != null && EndTime.Ticks != 0)
                {
                    return EndTime.Year + "年" + EndTime.Month.ToString("00") + "月" + EndTime.Day.ToString("00") + "日" + " " + EndTime.Hour.ToString("00") + ":" + EndTime.Minute.ToString("00") + ":" + EndTime.Second.ToString("00");
                }
                return "";
            }
        }
        /// <summary>
        /// 起点
        /// </summary>
        private string _StartPoint;
        /// <summary>
        /// 起点
        /// </summary>
        public string StartPoint
        {
            get { return _StartPoint; }
            set
            {
                _StartPoint = value;
                RaisePropertyChanged(() => StartPoint);
            }
        }
        /// <summary>
        /// 终点
        /// </summary>
        private string _EndPoint;
        /// <summary>
        /// 终点
        /// </summary>
        public string EndPoint
        {
            get { return _EndPoint; }
            set
            {
                _EndPoint = value;
                RaisePropertyChanged(() => EndPoint);
            }
        }
        /// <summary>
        /// 任务状态 1：等待，2：执行中，3：已完成
        /// </summary>
        private string _Status;
        /// <summary>
        /// 任务状态 1：等待，2：执行中，3：已完成
        /// </summary>
        public string Status
        {
            get { return _Status; }
            set
            {
                _Status = value;
                RaisePropertyChanged(() => Status);
            }
        }
        /// <summary>
        /// 任务排序 只有等待中的任务才有排序
        /// </summary>
        private Int64 _OrderNo;
        /// <summary>
        /// 任务排序 只有等待中的任务才有排序
        /// </summary>
        public Int64 OrderNo
        {
            get { return _OrderNo; }
            set
            {
                _OrderNo = value;
                RaisePropertyChanged(() => OrderNo);
            }
        }
        /// <summary>
        /// 任务排序 只有等待中的任务才有排序
        /// </summary>
        private int _DataOrderNo;
        /// <summary>
        /// 任务排序 只有等待中的任务才有排序
        /// </summary>
        public int DataOrderNo
        {
            get { return _DataOrderNo; }
            set
            {
                _DataOrderNo = value;
                RaisePropertyChanged(() => DataOrderNo);
            }
        }
        /// <summary>
        /// 是否删除 1=删除
        /// </summary>
        private int _IsDelete;
        /// <summary>
        /// 是否删除 1=删除  
        /// </summary>
        public int IsDelete
        {
            get { return _IsDelete; }
            set
            {
                _IsDelete = value;
                RaisePropertyChanged(() => IsDelete);
            }
        }
        /// <summary>
        /// 备注
        /// </summary>
        private string _Remark;
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark
        {
            get { return _Remark; }
            set
            {
                _Remark = value;
                RaisePropertyChanged(() => Remark);
            }
        }
    }
}
